<template>
  <div class="dashboard-container" style=" position: relative; height: 100%;">
      <h2>欢迎使用长春市消防救援支队信息网！</h2>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import adminDashboard from './admin'
import editorDashboard from './editor'

export default {
  name: 'Dashboard',
  components: { adminDashboard, editorDashboard },
  data() {
    return {
      currentRole: 'adminDashboard'
    }
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  methods:{
    clearAllCookie() {
      let keys = document.cookie.match(/[^ =;]+(?=\=)/g);
      if (keys) {
        for (let i = keys.length; i--;)
          document.cookie = keys[i] + '=0;expires=' + new Date(0).toUTCString()
      }
    },
  },
  created() {
    console.log("用户权限",this.roles)
    if (!this.roles.includes('admin')) {
      this.currentRole = 'editorDashboard'
    }
  }
}
</script>
<style>
.dashboard-container h2{
  font-size: 35px;
  text-indent: 2em;
  padding: 50px 0;
}
</style>
